package org.come.Jpanel;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.ImageIcon;
import javax.swing.JPanel;
import javax.swing.JTextArea;

import com.tool.btn.FormsOnOffBtn;
import com.tool.btn.RoleOperationPanelBtn;
import com.tool.tcpimg.UIUtils;
import com.updateNew.MyIsif;

 

public class SetPasswordJpanel extends JPanel implements MouseListener {

    private JTextArea passAreaText;// 设置密码框

    private RoleOperationPanelBtn btnSetPassword;// 设置密码按钮

    public SetPasswordJpanel() throws Exception {

    		this.setPreferredSize(new Dimension(358, 329));
            this.setLayout(null);
            this.setBackground(UIUtils.Color_BACK);

            // 关闭按钮事件
            FormsOnOffBtn offBtn = new FormsOnOffBtn("inkImg/old/2/1.png", 1, 32);
            offBtn.setBounds(358 - 37, 10, 25, 25);
            this.add(offBtn);

            // 密码text初始化
            passAreaText = new JTextArea();
            passAreaText.setBounds(132, 78, 175, 16);
            passAreaText.setOpaque(false);
            passAreaText.setBackground(new Color(0, 0, 0, 0));
            // passAreaText.setOpaque(true);
            passAreaText.setForeground(Color.WHITE);
            passAreaText.setCaretColor(Color.white);
            this.add(passAreaText);
            // 设置设置密码按钮
            btnSetPassword = new RoleOperationPanelBtn("skin/8100226/newbutton/B22.png", 1, UIUtils.COLOR_WHITE2,
                    UIUtils.TEXT_HY16, "设置密码");
            btnSetPassword.setBounds(143, 266, 99, 24);
            this.add(btnSetPassword);

    }

    ImageIcon icon;

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        	// 设置密码背景
            if (icon == null) {
                icon = new ImageIcon("inkImg/newbackground/B257.png");
            }

            g.drawImage(icon.getImage(), 0, 0, 358, 329, this);

    }

    @Override
    public void mouseClicked(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mousePressed(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mouseReleased(MouseEvent e) {

    }

    @Override
    public void mouseEntered(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mouseExited(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    public JTextArea getPassAreaText() {
        return passAreaText;
    }

    public void setPassAreaText(JTextArea passAreaText) {
        this.passAreaText = passAreaText;
    }

    public RoleOperationPanelBtn getBtnSetPassword() {
        return btnSetPassword;
    }

    public void setBtnSetPassword(RoleOperationPanelBtn btnSetPassword) {
        this.btnSetPassword = btnSetPassword;
    }

}
